<template>
  <van-nav-bar>
    <template #left>
      <i class="iconfont iconbtn_nav_back" @click="back"></i>
    </template>
    <template #title>
      <h3>{{ title }}</h3>
    </template>
    <template #right>
      <span v-if="isSave" @click="save">保存</span>
    </template>
  </van-nav-bar>
</template>

<script>
export default {
  props: ['title', 'isSave'],
  methods: {
    back () {
      this.$emit('back')
    },
    // 暴露保存的事件
    save () {
      this.$emit('save')
    }
  }
}
</script>

<style lang="less" scoped>
.iconbtn_nav_back {
  font-size: 44px;
}
</style>
